#!/usr/bin/env python
# -*- conding : UTF-8 -*-
import sys, os
def dl_pic( px, sx, st, ed ):
	i=int(st)
	while i <= int(ed) :
		pp = "%02d" % i
		ppic = px + pp +sx
		os.system( "wget " + ppic )
		i+=1
def main():
	if len(sys.argv) == 5:
		px=sys.argv[1]
		sx=sys.argv[2]
		st=sys.argv[3]
		ed=sys.argv[4]
		dl_pic( px, sx, st, ed )
	else:
		print """dl_pic can download the picture on website,
if the picture's name is regular.
Usage: dl_pid.py [picture's path](exclude the extension) [extension] [start number] [end number]
Sample: dl_pic.py "http://music.geocities.jp/w32481/7867/images/le_kirara0" ".jpg" 3 45"""
if __name__ == "__main__":
	print '!!!  Under GPL  !!!\nWritten\
	by RAh-XePhON \n @ http://ToKyo-JuPiTer.Blogspot.com/'
	main()
	print 'Exit'
	sys.exit(0)
